package com.atguigu.day03.test;

import java.util.Scanner;

public class IfElseTest2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数:");
        int num = sc.nextInt();
        if (num % 2 == 0){
            System.out.println(num + "是一个偶数");
        }else{
            System.out.println(num + "不是一个偶数");
        }



        System.out.println("请输入一个年份:");
        int year = sc.nextInt();
        if( year % 400 == 0 || (year % 4 == 0 && year % 100 != 0) ){
            System.out.println(year + "是一个闰年");
        }else{
            System.out.println(year + "不是一个闰年");
        }

    }
}
